
class ChatListBean {
  List<ChatListDataBean> data;
  Map<String,dynamic> toJson()=>jsonFromChatListBean(this);
  ChatListBean(Map<String,dynamic> json){
    jsonToChatListBean(this,json);
  }
}

class ChatListDataBean {
  int sendId;
  int receiveId;
  int num;
  String lastMessage;
  String lastTime;
  String sendNick;
  String sendLogo;
  String receiveNick;
  String receiveLogo;
  int id;
  Map<String,dynamic> toJson()=>jsonFromChatListDataBean(this);
  ChatListDataBean(Map<String,dynamic> json){
    jsonToChatListDataBean(this,json);
  }
}


//////////////////////////////////////////////////////////////

//----------------------------解析方法-------------------------

/////////////////////////////////////////////////////////////



void jsonToChatListBean(ChatListBean bean,Map<String,dynamic> json){
  if(json==null) return;
  bean.data=[];
  for(var item in json['data']??[]){
    bean.data.add(ChatListDataBean(item));
  }

}
void jsonToChatListDataBean(ChatListDataBean bean,Map<String,dynamic> json){
  if(json==null) return;
  bean.sendId=int.parse(json['send_id']?.toString()??'0');
  bean.receiveId=int.parse(json['receive_id']?.toString()??'0');
  bean.num=int.parse(json['num']?.toString()??'0');
  bean.lastMessage=json['last_message']?.toString()??'';
  bean.lastTime=json['last_time']?.toString()??'';
  bean.sendNick=json['send_nick']?.toString()??'';
  bean.sendLogo=json['send_logo']?.toString()??'';
  bean.receiveNick=json['receive_nick']?.toString()??'';
  bean.receiveLogo=json['receive_logo']?.toString()??'';
  bean.id=int.parse(json['id']?.toString()??'0');
}
Map<String,dynamic> jsonFromChatListBean(ChatListBean bean)=>{
  'data':bean.data,
};
Map<String,dynamic> jsonFromChatListDataBean(ChatListDataBean bean)=>{
  'send_id':bean.sendId,
  'receive_id':bean.receiveId,
  'num':bean.num,
  'last_message':bean.lastMessage,
  'last_time':bean.lastTime,
  'send_nick':bean.sendNick,
  'send_logo':bean.sendLogo,
  'receive_nick':bean.receiveNick,
  'receive_logo':bean.receiveLogo,
  'id':bean.id,
};
